package org.example.controller;


import org.example.service.DomainService;
import org.example.util.JsonData;
import org.example.vo.DomainVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ykc
 * @since 2025-03-09
 */
@RestController
@RequestMapping("/api/domainDO/v1")
public class DomainController {

    @Autowired
    private DomainService domainService;

    /**
     * 查询全部可⽤域名
     *
     * @return
     */
    @GetMapping("/list")
    public JsonData listAll() {
        List<DomainVO> list = domainService.listAll();
        return JsonData.buildSuccess(list);
    }
}

